/**
 * @author: SEKin 
 * @Date: 2025-04-01 10:43:19 
 * @description:  
 * @Last Modified time: 2025-04-01 10:43:19 
 */

// import { register} from "node:module";
// import { pathToFileURL} from "node:url";
import { getParams, mulExec, execute } from './util.ts';
import config from "./config.ts"
// 注册 ts-node ESM 加载器
// register('ts-node/esm', pathToFileURL('./'));

async function main () {
	const res = getParams();
	console.log(res);
	// const commands = (res.command as string).split(',')
	const commands = config.command;
	if(config.beforeStart){
		await config.beforeStart(execute)
	}
	await mulExec(commands).catch(err => console.log(err));
	if(config.beforeEnd){
		await config.beforeEnd(execute)
	}
	return '';
}

main().catch(errors=> console.log(errors));
